import http from '@/common/service/service.js'
import configService from '@/common/service/config.service.js'


import course from './course.js'
import island from './island.js'
import question from './question.js'

import user from './user.js'

import order from './order.js'

import todo from './todo.js'
import mind from './mind.js'
import wind from './wind.js'

const apiService = {

	...course,
	...user,
	...island,
	...order,
	...question,
	...todo,
	...mind,
	...wind,

	/**
	 * 获取文件访问路径
	 * @param avatar
	 * @param subStr
	 * @returns {*}
	 */
	getFileAccessHttpUrl(avatar, subStr) {
		if (!subStr) subStr = 'http'
		if (avatar && avatar.startsWith(subStr)) {
			return avatar;
		} else {
			return configService.staticDomainURL + "/" + avatar;
		}
	}
};

export default apiService;
